package org.linlinjava.litemall.admin.controller;


import org.linlinjava.litemall.admin.beans.annotation.LogAnno;
import org.linlinjava.litemall.admin.service.AdminPayMemberUserService;
import org.linlinjava.litemall.core.validator.Order;
import org.linlinjava.litemall.core.validator.Sort;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 管理支付会员用户控制器
 *
 * @author yliyun
 * @date 2022/09/14
 */
@RestController
@RequestMapping("/admin/payMemberUser")
@Validated
public class AdminPayMemberUserController {

    /**
     * 管理成员用户服务
     */
    @Autowired
    private AdminPayMemberUserService adminPayMemberUserService;

    /**
     * 列表
     *
     * @param userName   用户名
     * @param memberName 成员名
     * @param status     状态
     * @param page       页面
     * @param limit      限制
     * @param sort       排序
     * @param order      订单
     * @return {@link Object}
     */
    @GetMapping("list")
    @LogAnno
    public Object list(String userName, String memberName,Byte status,
                       @RequestParam(defaultValue = "1") Integer page,
                       @RequestParam(defaultValue = "10") Integer limit,
                       @Sort @RequestParam(defaultValue = "add_time") String sort,
                       @Order @RequestParam(defaultValue = "desc") String order ){
        return adminPayMemberUserService.queryPayMemberUser(userName,memberName,status
                                                            ,page,limit,sort,order);
    }
}
